package com.atguigu.java;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ThreeAndTwo {
    private String Date1;
    private String Date2;

    public String getDate1() {
        return Date1;
    }

    public ThreeAndTwo() {
    }

    public ThreeAndTwo(String date1, String date2) {
        Date1 = date1;
        Date2 = date2;
    }

    public void setDate1(String date1) {
        Date1 = date1;
    }

    public void setDate2(String date2) {
        Date2 = date2;
    }

    public String getDate2() {
        return Date2;
    }

    public void SanEr() throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date11 = sdf.parse(getDate1());

        Date date22 = sdf.parse(getDate2());


        long day = (date22.getTime() - date11.getTime()) / (1000 * 60 * 60 * 24) + 1;
        if (day % 5 == 1 || day % 5 == 2 || day % 5 == 3) {
            System.out.println("打渔");
        } else {
            System.out.println("晒网");
        }
    }
}
